<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script type="text/javascript" charset="UTF-8" src="../../../js/class/vue.min.js"></script>
	</head>
	<body>
		<div id="vue-app">
			<div>
				<div>
					<h1>hi...</h1>
					<button type="button" @click="clickNow">{{title}} You clicked me {{count}} times.</button>
				</div>
			</div>
		</div>
		<script type="text/javascript">
			Vue.component('button-counter',{//自定义标签名
				props: ['title'],//组件要传入数据的属性名
				data: function(){
					return {
						count: 0,//组件初始化数据
					}
				},
				template: '<div><h1>hi...</h1><button type="button">{{title}} You clicked me {{count}} times.</button></div>',
				methods: {
					clickNow: function(){
						this.count++;
					},
				}
			})
			var vue = new Vue({
				el: "vue-app",
				data: {
					
				},
			})
		</script>
	</body>
</html>